var should = require('should');
var shopHandler = require('../../../app/servers/user/handler/shopHandler');
var config = require('../../config');
var analyze = require('kc-analyze');
var configUtil = require('../../../app/util/configUtil');

suite('测试shopHandler', function () {
    setup(function (done) {
        var analyze_config = configUtil.load('analyze');
        var game_config = configUtil.load('game');
        analyze.initialize({
            host: analyze_config.host,
            server_id: game_config.server_id
        });
        done();
    });

    //     suite('Handler.prototype.buy', function () {
    //         test('vip特权商店购买', function (done) {
    //             var msg = {};
    //             msg.shop_id = 103;
    //             var session = {};
    //             session.uid = config.role_id;

    //             var vip_shop_handler = new shopHandler();
    //             vip_shop_handler.vipShopBuy(msg, session, function (err, res) {
    //                 // console.log('res:', res);
    //                 done();
    //             });
    //         });
    //     });

    //     suite('Handler.prototype.list', function () {
    //         test('vip特权商城列表', function (done) {
    //             var msg = {};
    //             var session = {};
    //             session.uid = config.role_id;

    //             var vip_shop_handler = new shopHandler();
    //             vip_shop_handler.vipShopList(msg, session, function (err, res) {
    //                 done();
    //             });
    //         });
    //     });

    suite('Handler.prototype.discountShop', function () {
        test('折扣商店', function (done) {
            var msg = {};
            msg.shop_id = 2;

            var session = {};
            session.uid = config.role_id;

            var shop_handler = new shopHandler();
            shop_handler.discountShop(msg, session, function (err, res) {
                console.log('res:', res);
                done();
            });
        });
    });

    suite('Handler.prototype.discountList', function () {
        test('折扣商店', function (done) {
            var msg = {};
            var session = {};
            session.uid = config.role_id;

            var shop_handler = new shopHandler();
            shop_handler.discountList(msg, session, function (err, res) {
                console.log('res:', res);
                done();
            });
        });
    });

    //suite('Handler.prototype.buy', function() {
    //test('领取资源商城奖励', function(done) {
    //var msg = {};
    //msg.shop_type = config.shop_type;
    //var session = {};
    //session.uid = config.role_id;

    //var shop_handler = new shopHandler();
    //shop_handler.buy(msg, session, function(err, res) {
    //done();
    //});
    //});
    //});

    // suite('Handler.prototype.list', function () {
    //     test('资源商城列表', function (done) {
    //         var msg = {};
    //         msg.shop_type = config.shop_type;
    //         var session = {};
    //         session.uid = config.role_id;

    //         var shop_handler = new shopHandler();
    //         shop_handler.list(msg, session, function (err, res) {
    //             done();
    //         });
    //     });
    // });
});
